package trinnes.oliver.unimaas.smartpentalath;

import java.awt.Polygon;

/**
 *
 * @author Oliver Trinnes
 */
public class Hexagon extends Polygon
{
  private static final long serialVersionUID = 1L;
  
  private int width;
  private int height;

  public Hexagon(int size)
  {
    super();
    int distLeftRight = (int) ((size - Math.sin(Math.toRadians(60)) * size) / 2);
    int southWestX = distLeftRight;
    int northWestX = southWestX;
    int northX = (int) (0.5 * size);
    int northEastX = size - distLeftRight;
    int southEastX = northEastX;
    int southX = northX;
    int southWestY = (int) (0.75 * size);
    int northWestY = (int) (0.25 * size)-1;
    int northY = 0;
    int northEastY = northWestY-1;
    int southEastY = southWestY;
    int southY = size-1;
    xpoints = new int[]
            {
              southWestX, northWestX, northX, northEastX, southEastX, southX
            };
    ypoints = new int[]
            {
              southWestY, northWestY, northY, northEastY, southEastY, southY
            };
    npoints = 6;
    width = northEastX-northWestX;
    height = southWestY;
  }

  public int getWidth()
  {
    return width;
  }

  public int getHeight()
  {
    return height;
  }

}
